filterCities(self, params['c731103e-8674-4502-bf45-afd1345beb46']);



/**
 * 对表格行添加选中背景
 */
function selectDataStyle(self, params) {
    // 找到表格组件元素
    var ele = self.$$element("table_frgmg1");
    if (ele && ele.$el) {
        // 首先清除旧标记
        var oldls = ele.$el.querySelectorAll("tr[old-click='old-click']");
        if (oldls.length) {
            for (let i = 0; i < oldls.length; i++) {
                let n = oldls[i];
                if (n) {
                    // 仅做标记
                    n.removeAttribute("old-click", "old-click");
                    n.style.backgroundColor = "unset";
                }
            }
        }

        // params.id为列表中的主键列，根据实际情况调整
        let id = parseInt(params['c731103e-8674-4502-bf45-afd1345beb46']);
        let rowKey  = getRowKeyById(self.dataList, id);
        var selector = "tr[data-row-key='" + rowKey + "']";
        var ls = ele.$el.querySelectorAll(selector);
        if (ls.length) {
            for (let i = 0; i < ls.length; i++) {
                let node = ls[i];
                if (node) {
                    // 仅做标记
                    node.setAttribute("old-click", "old-click");
                    node.style.backgroundColor = "#F0F9FF";
                }
            }
        }
    }
}

function getRowKeyById(data, idValue) {
    const item = data.find(element => element.id.value === idValue);
    return item ? item.rowkey : null;
}








function main(list) {
    debugger
    let self = this;
    setTimeout(res => {
        if (!list || !list.length) {
            // 对下一级列表进行过滤
            filterCities(self, -1)
            return;
        }
        // 参数 list 为当前页所有记录
        console.log(list, "数据");
        // 获取需要勾选的记录
        var ele = self.$$element("table_frgmg1");
        ele.$refs["domain_name-0"].parentElement.parentElement.click();
    })


}

function filterCities(self, id) {
    let pageTableList = self.$$("page_widget_list_1tzgqn");
    window.domainId = id;
    if (pageTableList) {
        if (pageTableList.dataEngine && pageTableList.dataEngine.state) {
            // 给列表组件设置参数，参数名meter_id为要过滤列表中的列名，后面为参数值，取自树节点参数
            pageTableList.$children[0].$$setExtraParams({
                senior_id: id
            })
            // 找到列表部件中的表格组件元素
            let tableComp = pageTableList.dataEngine.state.getElement("table_gwen2a");
            if (tableComp) {
                //执行列表刷新
                tableComp.$$refreshData();
            }
        }
    }
}
